#pragma once
#include "InternalsPlugin.hpp"
#include "Sprite.hpp"
#include "TypeDefs.hpp"

class WidgetSpeedTrap
{
public:
	WidgetSpeedTrap(const char *pRootPath, const char *pIniUIFilename, const char *pIniDriverMappingFilename, const char *pIniVehiculeClassMappingFilename);
	~WidgetSpeedTrap(void);

	void init(const ScreenInfoV01 &info, float ratio, float ratioWidth, float ratioHeight, Sprite spriteList[]);
	void updateData(const VehicleScoringInfoV01 &vinfo, DriverInfo & di, bool isViewedDi, TimingInfo & timingInCategory, double mET);
	void render(int profileIndex, const ScreenInfoV01 &info, DriverInfo & viewedDi, const LPD3DXFONT *fontList, const D3DCOLOR *colorList, Sprite spriteList[], double mET); 

//private:
  bool initialized;
 
  int nbProfiles;
  PluginProfile profiles[10];

  RECT tmpRect;

  const char *rootPath;
  char iniUIFilename[800];

  // widget
  bool available;
  ImageData bgImageData;
  int displayDurationS;

  int numberOfLapBeforeDisplaying;
    // tools
  char tmp[1000];

  // speed viewed
  bool speedAvailable;
  TextData speedTextData;
  char speedStr[20]; 

  // best speed
  bool bestSpeedAvailable;
  TextData bestTextData;
  char bestStr[20]; 

};

